/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.portletinhell.DAO;

import com.portletinhell.modell.Phrase;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Andrey
 */
public class PhraseDAO implements IPhraseDAO{

    public List<Phrase> getPharses() {
       Query query=entityManager.createQuery("Select Phrase from Phrases Phrase");
       List<Phrase> result= query.getResultList();
       
       return result;
    }
    
    private EntityManager entityManager;

    @PersistenceContext
    public void setEntityManager(EntityManager entityManager) {

        this.entityManager = entityManager;
    }
  
}
